package com.yjj.demo.jpa.user.web;

import com.yjj.demo.common.web.AbsController;
import com.yjj.demo.jpa.user.service.UserService;
import com.yjj.demo.jpa.user.vo.UserAddVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 *
 *
 * @author yangjiajia
 * @time 2021/9/24 23:15
 */
@RestController
@RequestMapping("/user")
public class UserController extends AbsController {

    @Autowired
    private UserService userService;

    @PostMapping("/add")
    public long add(@Valid @RequestBody UserAddVo addVo) {
        return userService.add(addVo);
    }
}
